import pandas as pd
from pandas import DataFrame
import numpy as np

'''
读取文件名称获取
'''
def readfileExcel(filepath):
    data = pd.read_excel(filepath)
    list = data['链接']
    return list
def modifyExcel(filepath,data,sheetName):
    DataFrame(data).to_excel(filepath,sheet_name=sheetName,index=False, header=True)
def getFirstSheetName(filepath):
    data = pd.read_excel(filepath, sheet_name=None)
    return list(data)[0]
'''
读取第一个sheet的全部内容
'''
def readfirstData(filepath):
    data = pd.read_excel(filepath)
    return data
if __name__ == '__main__':
    filepath = "../doc/test.xlsx"
    # data = pd.read_excel(filepath,sheet_name=None)
    # print(list(data))
    # print(list(data)[0])
    # data = pd.read_excel(filepath)
    # data['上传路径'] = None
    # print(data)
    sheetName = getFirstSheetName(filepath)
    data = readfirstData(filepath)
    zipPath = "C:\\test\\zip\download\\1637109544392\\1637109544392.zip"
    zipPath = str(zipPath).replace('\\', '/')
    zipList = np.random.randn(54)
    #zipList.append(zipPath)
    print(data)
    print("data type is ",type(data))
    data['上传路径'] = zipList
    modifyExcel(filepath,data,sheetName)




